﻿using ConsoleApplication1;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using testPlayList;

namespace testWPF
{
    public class PlayListModel : ICommand
    {
        public PlayListModel(MediaElementViewModel mediaElementViewModel)
        {
            // TODO: Complete member initialization
            this.mediaElementViewModel = mediaElementViewModel;
        }

        public bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged
        {
            add { CommandManager.RequerySuggested += value; }
            remove { CommandManager.RequerySuggested -= value; }
        }

        private MediaElementViewModel mediaElementViewModel;


        public void Execute(object parameter)
        {
            string action = (string)parameter;
            if (action == "Load")
            {
                AudioPlaylist audioPlaylist = new AudioPlaylist(Library.getFromDir("F:\\Games\\LoL\\Riot Games\\League of Legends\\RADS\\projects\\lol_air_client\\releases\\0.0.1.0\\deploy\\assets\\sounds\\tr_TR\\champions", ".mp3"));
                mediaElementViewModel.library = audioPlaylist._playlist;
            }
        }
    }
}
